<?php
/**
 * 商品管理
 *
 *
 *
 *
 * @copyright  Copyright (c) 2007-2013 ShopNC Inc. (http://www.shopnc.net)
 * @license    http://www.shopnc.net
 * @link       http://www.shopnc.net
 * @since      File available since Release v1.1
 */
defined('InShopNC') or exit('Access Invalid!');

class modules_newModel extends Model{
    public function __construct(){
        parent::__construct('modules_new');
    }

    /**
     * 新增数据
     *
     * @param array $data 数据
     */
    public function addData($data) {
        return $this->table('modules_new')->insert($data);
    }
    /**
     * 修改数据
     *
     * @param array $condition 	条件
     * @param array $data 		数据
     */
    public function updateData($condition,$data){
    	return $this->table('modules_new')->where($condition)->update($data);
    }
    /**
     * 删除数据
     * @param array $condition 	条件
     */
    public function delData($condition){
    	return $this->table('modules_new')->where($condition)->delete();
    }
    /**
     * 查询数据
     * @param array $condition 	条件
     *
     */
    public function showData($condition,$field = '*',$order = 'modules_id desc',$limit = '0,30'){
    	return $this->table('modules_new')->field($field)->where($condition)->order($order)->limit($limit)->select();
    }
    /**
     * 查询根据条件 一条数据
     * @param array $condition 	条件
     */
    public function showOneData($condition){
    	return $this->table('modules_new')->where($condition)->find();
    }
}
